// 2013-9-12上午02:21:54  net.betou.trade.main.dao.agency.impl.AdminDaoImpl.java

package net.betou.trade.main.dao.agencyorproxy.impl;

import org.springframework.stereotype.Repository;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.main.dao.agencyorproxy.AdminDao;

/**
 * 
 * @author 叶装装
 */
@Repository
public class AdminDaoImpl extends DaoImpl implements AdminDao{

	public AgentAndAdmins findAdmin( Integer id ){
		String hql = "from AgentAndAdmins bean where bean.id=? and bean.system=? and bean.justAdmin=?";
		return ( AgentAndAdmins ) findUnique( hql, id, false, true );
	}

	public AgentAndAdmins findBySelf( Integer selfId, Integer id ){
		String hql = "from AgentAndAdmins bean where bean.id=? and bean.parent.id=? and bean.system=? and bean.justAdmin=?";
		return ( AgentAndAdmins )findUnique( hql, id, selfId, false, true );
	}
}
